import axiosRequest from "@/api/axios-optimize"

// 获取登录日志
export function getLoginLogList(
  data = {},
  config = {
    noShowLoading: true, // 配置不展示加载动画
    preventDuplicateRequestsType: "cancel" // 配置重复请求时 取消前面的请求
  }
) {
  return axiosRequest.get(`/xiaobuAdmin/log/getLoginLogList`, { params: data, ...config })
}

// 获取操作日志
export function getOperateLogList(
  data = {},
  config = {
    noShowLoading: true, // 配置不展示加载动画
    preventDuplicateRequestsType: "cancel" // 配置重复请求时 取消前面的请求
  }
) {
  return axiosRequest.get(`/xiaobuAdmin/log/getOperateLogList`, { params: data, ...config })
}

// 获取操作日志详情
export function getOperateLogDetailById(data = {}, config = {
  preventDuplicateRequestsType: "prevent"
}) {
  return axiosRequest.get(`/xiaobuAdmin/log/getOperateLogDetail/${data.id}`, { params: {}, ...config})
}

// 获取登录日志详情
export function getLoginLogDetailById(data = {}, config = {
  preventDuplicateRequestsType: "prevent"
}) {
  return axiosRequest.get(`/xiaobuAdmin/log/getLoginLogDetail/${data.id}`, { params: {}, ...config})
}